<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('good_records', function (Blueprint $table) {
            $table->id();
            $table->foreignId('order_id')->constrained()->cascadeOnDelete()->comment('订单ID');
            $table->string('name')->comment('收件人');
            $table->string('order_number')->nullable()->comment('快递单号');
            $table->string('good_address', 500)->nullable()->comment('收获地址');
            $table->string('freight')->nullable()->comment('运费');
            $table->string('description', 500)->nullable()->comment('描述');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('good_records');
    }
};
